UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qbym/hyXzmR4qJg32a/MM1DrU8+8IYit1f0KX3ZejSU='
WHERE
key_id = '55e6fa04171d5d5ec317f34d4686ea5f64ee99cda17b3b44d34b13ac58174577'
AND (
token = 'Qbym/hyXzmR4qJg32a/MM1DrU8+8IYit1f0KX3ZejSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)