UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AbvtGE9hh7hExdO73pIkpHirFs2iNye8GGYsXBtn4po=' 
WHERE 
  key_id = '468e0a3e184e72892ac2fde4a033db0458cd204f8d778d9cd64708e638e2350b' 
  AND (
    token = 'AbvtGE9hh7hExdO73pIkpHirFs2iNye8GGYsXBtn4po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054