UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8U/U9ol4bQD17KWOMkFdQPB+RKvmBYePHhCa3RNCllQ='
WHERE
key_id = 'd2048d7113d842998ab4f1cdd1db5d02bb74dc2ffb078b1a709a9a6b75ad799d'
AND (
token = '8U/U9ol4bQD17KWOMkFdQPB+RKvmBYePHhCa3RNCllQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)