UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nL4IYLUqAhDr4HGwDDKAzT8RonqaDs4NSQuUU9IBS9M='
WHERE
key_id = 'd4f1308c520c9baa61d0ca3d5c605314de2ae304fa36c6cc91688d44dadef260'
AND (
token = 'nL4IYLUqAhDr4HGwDDKAzT8RonqaDs4NSQuUU9IBS9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)