UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nKmUdQJu2V7D1KI0YUZ2rdK8hZZxW7M5PLXEL3XXi5w=' 
WHERE 
  key_id = '14c50c976a981096ba9631224011d047a9917817f0e05af76a1a2b62180b5a77' 
  AND (
    token = 'nKmUdQJu2V7D1KI0YUZ2rdK8hZZxW7M5PLXEL3XXi5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022