UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BNo5yIAJPqCFlzzRpSfu1XJ9uOlNggvC03r/bBJNzJk='
WHERE
key_id = '54cc25c8f1a3080348de8dfc841103352730c5aad0e025eb93d76a407e3b0ea4'
AND (
token = 'BNo5yIAJPqCFlzzRpSfu1XJ9uOlNggvC03r/bBJNzJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)