UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWU6ijPWyDsB3aqSnhi7lQqo0RIFvyDwGd4YY74wdlY='
WHERE
key_id = 'e0f3deff5d683a566653a1e80973f28aef71c85380ea79327cf77c53f28081da'
AND (
token = 'ZWU6ijPWyDsB3aqSnhi7lQqo0RIFvyDwGd4YY74wdlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)