UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YKYsHUKnEmgOm7rJboNh7HvHZ2TOQUJBCvAupGaDM4g=' 
WHERE 
  key_id = '3d46e187df59625bd67d953488b1029b382ee7bfc1913d51d0d6abd78535deca' 
  AND (
    token = 'YKYsHUKnEmgOm7rJboNh7HvHZ2TOQUJBCvAupGaDM4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033