UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxGjIKfE3adkqJMdylLYuRP5mSXlGhO7MlnyvZaGS/8='
WHERE
key_id = '727e9afc17a6af11ca96e7f157ed92a7d833896d6fe81810daa5c2f0c5d7fbcf'
AND (
token = 'uxGjIKfE3adkqJMdylLYuRP5mSXlGhO7MlnyvZaGS/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)