UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ftw1Ds2e273nFwrpmVMemCkBGkJ7tu1GiPpkma/76hI='
WHERE
key_id = 'fa660dcf243b5f783e2b589e5d3254e9dce14396ee5cae7de8b494a965a7e139'
AND (
token = 'ftw1Ds2e273nFwrpmVMemCkBGkJ7tu1GiPpkma/76hI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)