UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VqnFlDPvglHomAVhNdPXHJ/ligkv7/I2c4mgjvJR7ww='
WHERE
key_id = '2f57381f03312ff9c49c0cbd77c41af4743aa57c46261ac53d9459a861a3c82f'
AND (
token = 'VqnFlDPvglHomAVhNdPXHJ/ligkv7/I2c4mgjvJR7ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)