UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Q3ScW8JUDU0X3Hv9me93qFePmvV8QxVdtWXsMSoOkw='
WHERE
key_id = 'ea5be6c6eb75d3fd458480b32f076dd4bb5a26c02193262e7f018af216aa1bdb'
AND (
token = '6Q3ScW8JUDU0X3Hv9me93qFePmvV8QxVdtWXsMSoOkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)