UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JULPlGB4ULt2Q73d/3vIWJWYJAdwYpdp0l/k0iaxv2g='
WHERE
key_id = 'c796733065cc2ab285e472a76b0c5f763367ba09dadda386c4b1d8b126749128'
AND (
token = 'JULPlGB4ULt2Q73d/3vIWJWYJAdwYpdp0l/k0iaxv2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)