UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TDTW4EaMsbh6m1suvyhHD0KWSNSMGt8HTFb/iPxEhO4='
WHERE
key_id = '4ebfa8f6d0474cfec6eec7bf0ce866b0e92af52b3c6e969b53dfceb85927a787'
AND (
token = 'TDTW4EaMsbh6m1suvyhHD0KWSNSMGt8HTFb/iPxEhO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)