UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jnY7q2oPUbgb4C26DQfdX9tqq8rVKqxvAf1/lQdrUkY=' 
WHERE 
  key_id = '7a21a301c5ff0299be151d343864918ef2fb0baed3d7a7495d89ee632dcb2bd7' 
  AND (
    token = 'jnY7q2oPUbgb4C26DQfdX9tqq8rVKqxvAf1/lQdrUkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012