UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XuXEMD6AoqDVZ9aOdkAjU/6ATuHIM35oP2zf5t/TMD4='
WHERE
key_id = '271724304ff644af744e37fbc463fb93d0e6e4a0c33abc054542432d29fe2ca4'
AND (
token = 'XuXEMD6AoqDVZ9aOdkAjU/6ATuHIM35oP2zf5t/TMD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)