UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JJliEOJhsywmIFbgwBmGrofz8UAWfbjWmdAMe93zRj4='
WHERE
key_id = '379d0233a822595e3157ccecd2c8fde1253a87e0117b6cef10cd56b274a5ac76'
AND (
token = 'JJliEOJhsywmIFbgwBmGrofz8UAWfbjWmdAMe93zRj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)