UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h4tdspEHoBTFqlP0c77XkrLDs6Vmxd9fJXMJVu6VBfU='
WHERE
key_id = 'fb700db3d0c69fd0373924046f268a04c827047581ae73a5a42fe692f6308962'
AND (
token = 'h4tdspEHoBTFqlP0c77XkrLDs6Vmxd9fJXMJVu6VBfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)