UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Jsno7pkjKPA+1yDVaXQixOiwVJjeOiitYmwrAoMFJI=' 
WHERE 
  key_id = '1c195bee405ad728df3d90dd309f0af77da8882d0ae844cca26790b05e3587c3' 
  AND (
    token = '9Jsno7pkjKPA+1yDVaXQixOiwVJjeOiitYmwrAoMFJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027