UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OfQBNdzayh3g1NbkVZ8XTwDmgunVj6tO48PH4bir0PA=' 
WHERE 
  key_id = 'fdde8c3c98b0afeb3f7f80159df5dad36d7b67dc2ed35318007c8b271c4bf532' 
  AND (
    token = 'OfQBNdzayh3g1NbkVZ8XTwDmgunVj6tO48PH4bir0PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030