UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PyrRoeQ84jOBH4B9BMoEhqj+ZeWwa5PWo7M/SUiQJYs=' 
WHERE 
  key_id = 'c5286926895ef800ab547d61b7d4591505751cc0ea60b10d9788d8ca54bad380' 
  AND (
    token = 'PyrRoeQ84jOBH4B9BMoEhqj+ZeWwa5PWo7M/SUiQJYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038