UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YlyOODq0LwGBxsr8Di5TEcebPn9HxW/lufCS4dHHg4o=' 
WHERE 
  key_id = '5af270fcbccf51daa000b8849ec7487daaafe13bf581fd5acf6f560d43816470' 
  AND (
    token = 'YlyOODq0LwGBxsr8Di5TEcebPn9HxW/lufCS4dHHg4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028