UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVpIaJazgy2lnzFB7xvBAxPBlxNdFEHvt/Uw6DC6QBg='
WHERE
key_id = 'e328f611910fe7dcedae7bd2b5f25797581e981904a693e2a93ad6ccce5ca5f2'
AND (
token = 'aVpIaJazgy2lnzFB7xvBAxPBlxNdFEHvt/Uw6DC6QBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)