UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UpXM/2WTm9Nwl/AQtIKgn6pZOxSovl0yqsUiOMR8NXI='
WHERE
key_id = 'de3ecb376bfd4bbb5293410f4f7945acd2ad53e958509f0ff2be5c94bcc53bfd'
AND (
token = 'UpXM/2WTm9Nwl/AQtIKgn6pZOxSovl0yqsUiOMR8NXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)