UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jYbcsNBPhM2TkLZkETWvhaEZSaiUGmXCOK+3zKBOPr4='
WHERE
key_id = 'cd75ab4369b06bf02c3b4807c4d922e38937d79ce7c720868c4b10a301a4c5c8'
AND (
token = 'jYbcsNBPhM2TkLZkETWvhaEZSaiUGmXCOK+3zKBOPr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)