UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JxQaU9oNhzEjOj3ePNRP2LXhOpfZhiEBfKu5NCS8vqA='
WHERE
key_id = '938beb7606e2b6b90b5b4ea4bbc318f0297dab29daba18ec3c9f9ca30ac34ff8'
AND (
token = 'JxQaU9oNhzEjOj3ePNRP2LXhOpfZhiEBfKu5NCS8vqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)