UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7RA9LkP4WgCWuUYOYvOVMBA3MnasqeEGtsuDvY4TKAA=' 
WHERE 
  key_id = 'd2f57a3dd5c00788a61ab5e39d42ae9f854c453aa8f21fde75204dd62e0c23f1' 
  AND (
    token = '7RA9LkP4WgCWuUYOYvOVMBA3MnasqeEGtsuDvY4TKAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032