UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mpSuwfYoCZ4l/MrvG9eKKaCeGa3M95ApemQsMMZ0Rl8='
WHERE
key_id = 'ca56f195208b7d6f973fee47594c98ac6e29796fbba561ee4a4eae9c97116587'
AND (
token = 'mpSuwfYoCZ4l/MrvG9eKKaCeGa3M95ApemQsMMZ0Rl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)