UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'De7zUcx7in8pIJR+mrOZbyGMKcXr6wrYeNyNlNN8rgI=' 
WHERE 
  key_id = 'a97bebf1168defe2ec52342bfed8d317efc5aeb55af645ad41ffd9fa5222016d' 
  AND (
    token = 'De7zUcx7in8pIJR+mrOZbyGMKcXr6wrYeNyNlNN8rgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027