UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'quq/wR50RbLJh2j/G4cP/N2OgzzXO0EixtZobjtVD9Y=' 
WHERE 
  key_id = 'de8e691a96f6f9f2be0ae0b52175e5caab39309cc79c26a1c74adb93a1a9ace6' 
  AND (
    token = 'quq/wR50RbLJh2j/G4cP/N2OgzzXO0EixtZobjtVD9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057