UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1FpzhoUGBtSxszRC3vUpAUDe8eBYZggBGf3TM7eYjtg=' 
WHERE 
  key_id = 'c0b55cc5f22c29979c7fbf90ced6b31ab1c0db7505fad2eee82d7511aa4cb379' 
  AND (
    token = '1FpzhoUGBtSxszRC3vUpAUDe8eBYZggBGf3TM7eYjtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032