UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KWFfIysU3DwjZ6oQw+eNvjP7LsZjNAS6IodXoBLcDH4=' 
WHERE 
  key_id = '493941b3e212ca276217fc48469e8796110bc9becd2bea0a8b3a888fde214c66' 
  AND (
    token = 'KWFfIysU3DwjZ6oQw+eNvjP7LsZjNAS6IodXoBLcDH4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031