UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZdV1rX5BTBnWaEzpMAE+G7qEf89N1SBkUDT4rJQ4fIU='
WHERE
key_id = 'ed28cf57b234dff86a06308f6f8fbc70393112311a2c947a3e6273fd4bd9b59f'
AND (
token = 'ZdV1rX5BTBnWaEzpMAE+G7qEf89N1SBkUDT4rJQ4fIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)