UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9UYr7PpL5m8cdwe2FRjrQS1q4cLRfF0cHf1vE0DpujQ='
WHERE
key_id = '848d13c7a96bed5fcc2a2c06313d2c339b9af3efb879124d7992c5f2fbab6fd8'
AND (
token = '9UYr7PpL5m8cdwe2FRjrQS1q4cLRfF0cHf1vE0DpujQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)