UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bLsWq6mSEoe5pIETidWImUcjExDAVDkoBsndewJRgRQ='
WHERE
key_id = '4b6afc32f817ea38e0d765e5770d409246d7e581a5122b6d54beca21325079e3'
AND (
token = 'bLsWq6mSEoe5pIETidWImUcjExDAVDkoBsndewJRgRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)