UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yb0esQXIINJ3GkG9jIHCtc0mhSlw18Qsqg2fUHwGA7w='
WHERE
key_id = '93bfbc8a1adaa213257aa3a3d094a3c73d94b50793173461e6a9e602a95c65b0'
AND (
token = 'Yb0esQXIINJ3GkG9jIHCtc0mhSlw18Qsqg2fUHwGA7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)