UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/CK+02xCkmIZm4V7CASbgWQyQgObkT8einXXlaCFHIk=' 
WHERE 
  key_id = '72cd3f8040ad308954ea682e934535d5852e7bf35f0f694e323aee740430fd25' 
  AND (
    token = '/CK+02xCkmIZm4V7CASbgWQyQgObkT8einXXlaCFHIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017