UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ugqf1CD689/w7Z+sfnFL0jJuCQbKnojTxEvSZtR++hY=' 
WHERE 
  key_id = 'a95cd97a03ce71db822d447f233d9030e5043029bc330440d7e9bc6059b1eda5' 
  AND (
    token = 'Ugqf1CD689/w7Z+sfnFL0jJuCQbKnojTxEvSZtR++hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031