UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ADPxNHoekJumkN235QnllwxIAYTmzQ0bYK7DwSxU5FM=' 
WHERE 
  key_id = 'b88e0baa9809abb310ed35213192a115a7eb8e55822eab6158ca3760f884e5f8' 
  AND (
    token = 'ADPxNHoekJumkN235QnllwxIAYTmzQ0bYK7DwSxU5FM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027